/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package digitaldreamers.games.ddmonsters.servers.gameserver.components;

/**
 *
 * @author DaoLe
 */
public class DuelCellComponent {
    
    public static class Coordinates {
        
        // <editor-fold defaultstate="collapsed" desc="Member variables">
        private int m_iX;
        private int m_iY;
        // </editor-fold>
        
        // <editor-fold defaultstate="collapsed" desc="Get/Set methods">
        
        // <editor-fold defaultstate="collapsed" desc="X">
        public int getX() {
            return m_iX;
        }
    
        public void setX(int iX) {
            m_iX = iX;
        }
        // </editor-fold>
    
        // <editor-fold defaultstate="collapsed" desc="Y">
        public int getY() {
            return m_iY;
        }
    
        public void setY(int iY) {
            m_iY = iY;
        }
        // </editor-fold>
        
        // </editor-fold>
        
        // <editor-fold defaultstate="collapsed" desc="Constructors">
    
        // <editor-fold defaultstate="collapsed" desc="Coordinate(int iX, int iY)">
        public Coordinates(int iX, int iY) {
            m_iX = iX;
            m_iY = iY;
        }
        // </editor-fold>
    
        // </editor-fold>
        
        // <editor-fold defaultstate="collapsed" desc="Static methods">
        public static boolean compareCoordinates(Coordinates firstCoordinates, Coordinates secondCoordinates) {
            if(firstCoordinates == null || secondCoordinates == null) {
                return false;
            }
            return firstCoordinates.getX() == secondCoordinates.getX() && firstCoordinates.getY() == secondCoordinates.getY();
        }
        // </editor-fold>
    }
    
    // <editor-fold defaultstate="collapsed" desc="Member variables">
    private Coordinates m_Coordinates;
    private int m_iCellType;
    private boolean m_bCanMoveToHere;
    private PlayerCardComponent m_Card;
    private boolean m_bIsNoCardHere;
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Get/Set methods">
    
    // <editor-fold defaultstate="collapsed" desc="Coordinate">
    public Coordinates getCoordinates() {
        return m_Coordinates;
    }
    
    public void setCoordinates(Coordinates coordinates) {
        m_Coordinates = coordinates;
    }
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="Cell type">
    public int getCellType() {
        return m_iCellType;
    }

    public void setCellType(int iCellType) {
        m_iCellType = iCellType;
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Moving state">
    public boolean getMovementState() {
        return m_bCanMoveToHere && m_bIsNoCardHere;
    }

    public void setMovementState(boolean bIsMovable) {
        m_bCanMoveToHere = bIsMovable;
    }
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="Card">
    public PlayerCardComponent getCard() {
        return m_Card;
    }
    
    public void setCard(PlayerCardComponent card) {
        if(m_bCanMoveToHere) {
            m_Card = card;
            m_bIsNoCardHere = m_Card == null;
        }
    }
    // </editor-fold>
    
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="Constructors">
    
    // <editor-fold defaultstate="collapsed" desc="BattleCellComponent(int iX, int iY)">
    public DuelCellComponent(int iX, int iY) {
        m_Coordinates = new Coordinates(iX, iY);
        m_iCellType = 0;
        m_bCanMoveToHere = true;
        m_Card = null;
        m_bIsNoCardHere = true;
    }
    // </editor-fold>
    
    // </editor-fold>
}
